package com.atguigu.lease.web.app.controller.apartment;

import com.atguigu.lease.common.result.Result;
import com.atguigu.lease.web.app.service.ApartmentInfoService;
import com.atguigu.lease.web.app.vo.apartment.ApartmentDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Package: com.atguigu.lease.web.app.controller.apartment
 *
 * @Description:
 * @Author xiongkunYang
 * @Create 2025/4/23 9:18
 */
@Tag(name = "公寓信息")
@RestController
@RequestMapping("/app/apartment")
public class ApartmentController {

    private final ApartmentInfoService apartmentInfoService;

    public ApartmentController(ApartmentInfoService apartmentInfoService) {
        this.apartmentInfoService = apartmentInfoService;
    }

    @Operation(summary = "根据id获取公寓信息")
    @GetMapping("getDetailById")
    public Result<ApartmentDetailVo> getDetailById(@RequestParam Long id) {
        return Result.ok(this.apartmentInfoService.getApartmentDetailById(id));
    }


}
